package com.zz.ecommerce.myplatform;

import com.zz.ecommerce.menu.MenuInfo;
import com.zz.ecommerce.mybatis.handler.EmptyStringIfNullHandler;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 菜单dao
 *
 * @author
 */
@Repository
public interface MyPlatformDao {

    /**
     * select * from user_tab_comments where table_name like '%进口%'；
     * <p/>
     * <p/>
     * select * from t_worksheet;
     * <p/>
     * <p/>
     * select * from t_entryinfo;--海关 IO
     * <p/>
     * select * from t_decl_info;--国建 io
     * --decl_status  没有字典
     * <p/>
     * select * from t_cargo; --报关
     * <p/>
     * <p/>
     * select * from t_decl_goods;-- 报检
     * <p/>
     * select * from t_worksheet_goods;--综合
     */
    @Select("SELECT INDX,ID,PID,MENUNAME,URL,ISENABLED,MENUICON FROM SA_MENU_INFO t WHERE t.ISENABLED='1' " +
            "ORDER BY t.INDX ")
    @Results({
                 @Result(column = "URL", property = "url", jdbcType = JdbcType.VARCHAR,
                         typeHandler = EmptyStringIfNullHandler.class)
             })
    List<MenuInfo> queryAllMenus();
}
